import request from '../utils/request'

export function getRolesListApi () {
  return request.get('roles')
}

export function addRoleApi ({ roleName, roleDesc }) {
  return request.post('roles', { roleName, roleDesc })
}

export function getRoleApi (id) {
  return request({
    method: 'get',
    url: 'roles/' + id
  })
}

export function editRoleApi (id, roleName, roleDesc) {
  return request.put('roles/' + id, {
    roleName,
    roleDesc
  })
}

export function removeRoleApi (id) {
  return request.delete('roles/' + id)
}
